﻿#region usings
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using GalaSoft.MvvmLight.Messaging;
#endregion
namespace InsuranceAdjuster.Views {
    public partial class IncidentView : System.Windows.Controls.Page
    {

        #region Initializers

        public IncidentView() 
        {
            InitializeComponent();

            Messenger.Default.Register<DialogMessage>(
                this, message =>
                {
                    if (this.Visibility != System.Windows.Visibility.Visible
                        || this.IsEnabled == false
                        || this.Parent == null)
                        return;

                    var MyResult = MessageBox.Show(message.Content, "Information", message.Button);
                    message.ProcessCallback(MyResult);
                });
        }
        private void vinLabel_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e) {
            this.vinTextBox.Text = "3NA5656377";
        }
        #endregion
        
        private void vinTextBox_TextChanged(object sender, TextChangedEventArgs e) {
            
            // Use the VINParser to resolve Year, Make, Model
            //Helpers.VinCarInfo carInfo = Helpers.VINParser.Parse(vinTextBox.Text);

            //this.vehicleYearsAutoComplete.Text = carInfo.Year.Value.ToString();
            //this.vehicleMakeAutoComplete.Text = carInfo.Make;
            //this.vehicleModelComboBox.SelectedValue = carInfo.Model;

        }

        private void vehicleModelComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) {
            var ThisComboBox = sender as ComboBox;
            //ThisComboBox.IsSynchronizedWithCurrentItem
        }

    }
}
